/**
 * @file cm_led_ctrl.c
 * @author jmdvirus
 * @date 2021-06-22 13:55:40
 */

#include "cm_led.h"

static const CMLedImpl *cm_led_impl_list[] = {
#ifdef WITH_LED_NORMAL
    &cm_led_impl_normal,
#endif
    NULL,
};

CMLedImpl *cm_led_ctrl_find(const char *type)
{
    CMLedImpl  *impl = NULL;
    int i = 0;
    while ((impl = cm_led_impl_list[i++]) != NULL)
    {
        if (strncmp(impl->name, type, strlen(impl->name)) == 0)
        {
            return impl;
        }
    }
    return NULL;
}
